package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

/**
 * @Auther: Tangguo
 * @Date: 2023-04-30  13:20
 * @description: TODO
 */
@Mapper
public interface OrderDetailMapper {
    /**
     * @param orderDetails:
     * @return void
     * @description 批量插入订单明细数据
     */
    void insertBatch(List<OrderDetail> orderDetails);

    /**
     * @param orderIds:
     * @return List<OrderDetail>
     * @description 查询多条订单明细
     */
    List<OrderDetail> getByOrderIds(Set<Long> orderIds);

    /**
     * @param orderId:
     * @return List<OrderDetail>
     * @description 查询一条订单明细
     */
    @Select("select * from order_detail where order_id = #{orderId}")
    List<OrderDetail> getByOrderId(Long orderId);
}
